// Bootstrap Scripting Library
with(new ActiveXObject("Scripting.FileSystemObject"))for(var x in p=(".;js;"+new ActiveXObject("WScript.Shell").Environment("PROCESS")("PATH")).split(";"))if(FileExists(j=BuildPath(p[x],"js.js"))){eval(OpenTextFile(j).ReadAll());break}

var $DIR = cd(Assert.Folder($ScriptPath));

// clean out the obj directories
for(var each in {gsToolkit:0,mkProject:0,SynthFastCGI:0,WebWalker:0,ToolkitTests:0,SvnReverseProxy:0,DllExport:0,gSharp:0} ) {
    rmdir("{$DIR}\\{0}\\obj",each);
    rmdir("{$DIR}\\{0}\\bin",each);
}

// clean out output and intermediate directories.
rmdir("{$DIR}\\output");
rmdir("{$DIR}\\intermediate");


// clean up the visual studio artifacts
for(var each in dir(/\.ncb$|\.suo$|\.user$|\.sln\.cache$/) )
    erase(each);
    
// clean up snapshots
erase("gsToolkit.zip");
erase("gsToolkit-src.zip");

erase("SvnReverseProxy.zip");
erase("SvnReverseProxy-Src.zip");

erase("DllExport.zip");

erase("gSharp.zip");
